//
//  User.swift
//  Fancyswap
//
//  Created by Karim Safraoui on 2015-04-19.
//  Copyright (c) 2015 Jonathan Muschalle. All rights reserved.
//

import Foundation

class User {
    
    var username:   String = ""
    var email:      String = ""
    var locale:     String = ""
    var zip:        String = ""
    var city:       String = ""
    
    init(){
    
        if let _user_name = TegKeychain.get(fancy_ketchain_user_username){
            self.username = _user_name
        }
        else {
            self.username = fancy_user_username
        }
        
        if let _email = TegKeychain.get(fancy_ketchain_user_email){
            self.email = _email
        }
        else{
            self.email = fancy_user_email
        }
        
        if let _locale = TegKeychain.get(fancy_ketchain_user_locale){
            self.locale = _locale
        }
        else{
            self.locale = fancy_user_locale
        }
        
        if let _zip = TegKeychain.get(fancy_ketchain_user_zip){
            self.zip = _zip
        }
        else{
            self.zip = fancy_user_zip
        }
        
        
        if let _city = TegKeychain.get(fancy_ketchain_user_city){
            self.city = _city
        }
        else{
            self.city = fancy_user_city
        }
    }
    
}